setwd("/home1/30/jc227089/SRE/equil/ran_outs")

ccat<-c()
for (i in 1:126){
	fid<-paste("SRE-equil", i, ".RData", sep="")
	load(fid)
	ccat<-rbind(ccat, data)
}

save(ccat, file="SRE-equil_ccat.RData")


# calculate extinction probability 
ext<-ccat[,"g"]!=500
sumry<-tapply(ext, list(ccat[,"r"], ccat[,"hv"], ccat[,"dc"]), sum)
sumry<-sumry/5
save(sumry, file="SRE-equil_summary.RData")